package com.erik.lin.kafka;

import kafka.serializer.StringEncoder;
import org.apache.kafka.common.serialization.Serializer;

import java.util.Map;

/**
 * Created by Erik on 2017/9/20.
 */
public class EncodeingKafka implements Serializer<Object> {
    @Override
    public void configure(Map<String, ?> map, boolean b) {

    }

    @Override
    public byte[] serialize(String s, Object o) {
        return new StringEncoder(null).toBytes((String) o);
    }

    @Override
    public void close() {

    }
}
